package cn.bonoon.core.plugins;

import cn.bonoon.entities.plugins.AccountEntity;
import cn.bonoon.kernel.exceptions.PasswordVerifierException;
import cn.bonoon.kernel.support.services.GenericService;
import cn.bonoon.kernel.support.services.UserService;

/**
 * 登录账户的服务对象
 * 
 * @author jackson
 * 
 */
public interface AccountService extends GenericService<AccountEntity>, UserService {

	/**
	 * 未审核
	 */
	String DRAFT_NAME = "未审核";

	/**
	 * 正常状态
	 */
	String NORMAL_NAME = "正常";

	/**
	 * 不可用状态
	 */
	String FORBID_NAME = "禁用";
	
//	void update(AccountEntity entity,Long[] rids, Long[] gids);

//	void save(AccountEntity entity, String pwd, String repwd, Long[] rids, Long[] gids)throws PasswordVerifierException;
//
//	List<String> ownedModules(Long userId);

//	String defaultModule(String loginName);

//	List<Long> getRoleIdByUser(Long uid);

//	List<Long> getGroupIdByUser(Long uid);

//	List<GroupMemberEntity> getGroupMembers(Long accountId);

//	List<PrivilegeEntity> getPrivileges(Long uid);

//	List<GroupEntity> getGroups(Long uid);

//	List<RoleEntity> getRoles(Long uid);

	void modify(Long uid, String oldPwd, String newPwd, String repwd)throws PasswordVerifierException;
	
	String resetPassword(Long id, String pwd, String repwd, boolean enforce)throws PasswordVerifierException;

	String randomPassword(Long id, boolean enforce)throws PasswordVerifierException;

//	Page_delete<RoleEntity> accountRoles(Long id, PageCondition pc);

//	Page<GroupMemberEntity> accountGroup(Long id, PageCondition pc);
	
	AccountEntity get(Long id);

	AccountEntity findAccountByLoginName(String userAccount);

}
